package cn.com.gainfo.bktas.dao;


import javax.sql.DataSource;

import cn.yzyue.base.dao.AbstractDAO;
import cn.yzyue.base.tools.db.DB;
import cn.yzyue.base.tools.db.SQL;

public class AbleEftDAO extends AbstractDAO {
	
	public Boolean exisBankId(DataSource dataSource,String bankid){
		SQL sql = new SQL("select count(*) from provinbank where bankid = '"+bankid+"'");
		int no = DB.count(dataSource, sql);
		if(no > 0)
			return true;
		else
			return false;
	}
	
	public Boolean modAbleEft(DataSource dataSource,String bankid,String acceptbank){
		SQL sql = new SQL("update provinbank set ableeft='true',acceptbank='"+acceptbank+"' where bankid = '"+bankid+"'");
		return DB.alter(dataSource, sql);
	}
	
	public Boolean addBankInfo(DataSource dataSource,String[] infos){
		SQL sql = new SQL("insert into provinbank(bankid, bankname, clearbankid, areacode, nombankid, ableeft) values('"+infos[0]+"', '"+infos[1]+"', '"+infos[2]+"', '"+infos[3]+"', '"+infos[4]+"', '"+infos[5]+"')");
		return DB.alter(dataSource, sql);
	}

}
